package user;

import book.BookList;
import function.*;

public class Administrator extends User{
    @Override
    public void menu() {
        System.out.println("*****管理员*****");
        System.out.println("0. 退出");
        System.out.println("1. 展示图书");
        System.out.println("2. 搜索图书");
        System.out.println("3. 增加图书");
        System.out.println("4. 删除图书");
        System.out.println("***************");
    }

    public Administrator(String name) {
        super(name);
        functions = new Function[]{
                new Exit(),
                new Show(),
                new Search(),
                new Add(),
                new Delete()
        };
    }

    @Override
    public void choice(int num,BookList bookList) {
        functions[num].work( bookList);
    }
}
